package com.sl.proxy.client.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author: aoshiguchen
 * @date: 2022/6/16
 */
@Data
@ConfigurationProperties(prefix = "neutrino.proxy")
public class ProxyClientConfig {
    private Protocol protocol = new Protocol();
    private Tunnel tunnel = new Tunnel();
    private Client client = new Client();

    @Data
    public static class Protocol {
        private Integer maxFrameLength = 869295620;
        private Integer lengthFieldOffset = 0;
        private Integer lengthFieldLength = 4;
        private Integer initialBytesToStrip = 0;
        private Integer lengthAdjustment = 0;
        private Integer readIdleTime = 120;
        private Integer writeIdleTime = 20;
        private Integer allIdleTimeSeconds = 0;
    }

    @Data
    public static class Tunnel {
        private String keyStorePassword = "123456";
        private String jksPath = "test.jks";
        private String serverIp = "116.198.243.213";
        private Integer serverPort = 9000;
        private Boolean sslEnable = false;
        private Integer obtainLicenseInterval;
        private String licenseKey = "458b0f1602bd41fda817ecff8ad3962a";
        private Integer threadCount = 50;
        private String clientId;
        private Boolean transferLogEnable = true;
        private Boolean heartbeatLogEnable = true;
        private Reconnection reconnection = new Reconnection();
    }

    @Data
    public static class Client {
        //		private Tcp tcp;
        private Udp udp = new Udp();
    }

    @Data
    public static class Reconnection {
        private Integer intervalSeconds = 10;
        private Boolean unlimited = false;
    }

    @Data
    public static class Tcp {

    }

    @Data
    public static class Udp {
        private Integer bossThreadCount = 5;
        private Integer workThreadCount = 20;
        private String puppetPortRange = "10000-10500";
        private Boolean transferLogEnable = true;
    }
}
